Wireless local area network roaming method and communications apparatus

ABSTRACT

A wireless local area network roaming method and a communications apparatus are provided, to improve a roaming effect of a terminal device in a wireless local area network. In the method, a control device selects, in place of a terminal device, an optimal roaming access point of the terminal device, to reduce a time consumed for determining the optimal roaming AP. After the optimal roaming access point of the terminal device is determined, an associated access point instructs the terminal device to attempt to roam to the optimal roaming access point. Because duration required for searching for the optimal roaming AP is reduced, a probability of data loss of the terminal device in a roaming process can be reduced, and a roaming effect of the terminal device in the wireless local area network is improved.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims priority to Chinese Patent Application No.201910159909.4, filed on Mar. 4, 2019, which is hereby incorporated byreference in its entirety.

TECHNICAL FIELD

This application relates to the field of communications technologies,and in particular, to a wireless local area network roaming method and acommunications apparatus.

BACKGROUND

A wireless local area network (WLAN) may include a plurality of wirelessaccess points (AP), and the plurality of APs may be configured to have asame service set identifier (SSID). A terminal device may roam betweenthe plurality of APs in the WLAN, so that the terminal device can stillmaintain a connection to the network in a moving process.

When the terminal device reaches a set roaming condition due to impactof a mobile or an air interface environment, the terminal device detectsan optimal roaming AP in a current environment, and roams from acurrently connected AP (which may be referred to as an associated AP) tothe determined optimal roaming AP.

When the terminal device reaches the set roaming condition and does notroam, the terminal device is already at a border of signal coverage ofthe associated AP. In this case, the terminal device may not accuratelyreceive data sent by the associated AP. However, it takes a long timefor the terminal device to detect the optimal roaming AP in the currentenvironment. Consequently, data of the terminal device may be lost in aroaming process, and service experience is affected.

SUMMARY

Embodiments of this application provide a wireless local area networkroaming method and a communications apparatus, to improve a roamingability of a terminal device in a wireless local area network.

According to a first aspect, an embodiment of this application providesa wireless local area network roaming method. In the method, anassociated access point, that is, an access point associated with aterminal device, first sends a measurement instruction including anidentifier of the terminal device to a neighboring access point, andinstructs, by using the measurement instruction, the neighboring accesspoint to send measured signal strength of the terminal device to acontrol device. Then, the neighboring access point detects the signalstrength of the terminal device, and sends the obtained signal strengthof the terminal device to the control device. After obtaining the signalstrength of the terminal device, the control device determines anoptimal roaming access point of the terminal device based on the signalstrength of the terminal device, and indicates the determined optimalroaming access point to the associated access point by using a roamingaccess point indication. After receiving the roaming access pointindication, the associated access point sends a roaming instruction toinstruct the terminal device to attempt to roam to the optimal roamingaccess point.

In the foregoing technical solution, the control device selects, inplace of the terminal device, the optimal roaming access point of theterminal device, to reduce a time consumed for determining the optimalroaming access point. After the optimal roaming access point of theterminal device is determined, the associated access point instructs theterminal device to attempt to roam to the optimal roaming access point.Because duration required for searching for the optimal roaming accesspoint is reduced, a probability of data loss of the terminal device in aroaming process can be reduced, and a roaming effect of the terminaldevice in a wireless local area network can be improved.

In a possible design, the associated access point further sends a beaconrequest when sending the measurement instruction, where a receiveraddress of the beacon request is an address of the terminal device, anda value of a measurement mode field of the beacon request is active.

In the foregoing technical solution, the associated access point mayfurther send the beacon request at the same time when or almost at thesame time when sending the measurement instruction, to ensure that theneighboring access point receives, in a time period for measuring thesignal strength of the terminal device, a probe frame sent by theterminal device under trigger of the beacon request, and measures theprobe frame to obtain the signal strength of a signal of the terminaldevice.

In a possible design, the associated access point repeatedly sends thebeacon request, where lower signal strength of the terminal deviceindicates more frequent sending of the beacon request by the associatedaccess node.

In the foregoing technical solution, the associated access pointrepeatedly sends the beacon request, so that the terminal device mayrepeatedly send the probe frame based on the beacon request, to ensurethat the neighboring access point can receive the probe frame of theterminal device in the time period for measuring the signal strength ofthe terminal device, and obtain the signal strength of the terminaldevice based on the probe frame.

In addition, when the signal strength of the terminal device is lower,the associated access point may send the beacon request more frequently,so that the neighboring access point can receive a plurality of probeframes, and obtain the signal strength of the terminal device based onthe plurality of probe frames, to ensure accuracy of the obtained signalstrength of the terminal device.

In a possible design, the beacon request includes a channel list field,where the channel list field only includes an operating channel of theneighboring access point.

In the foregoing technical solution, in the roaming process, theterminal device usually selects the neighboring access point of theassociated access point as the optimal roaming access point of theterminal device. Therefore, the associated access point may add theoperating channel of the neighboring access point to the beacon request,so that the terminal device may need to scan only a channel indicated inthe beacon request, and does not need to scan all channels. This canreduce duration required by the terminal device in a scanning process,and improve scanning efficiency.

In a possible design, the roaming access point indication carries anidentifier of the optimal roaming access point and/or an identifier ofan operating channel of the optimal roaming access point.

In the foregoing technical solution, after determining the optimalroaming access point of the terminal device, the control device mayfurther indicate a roaming mode of the terminal device to the associatedaccess point by adding different information to the roaming access pointindication. For example, the control device may indicate, by adding onlythe identifier of the optimal roaming access point to the roaming accesspoint indication, that the roaming mode of the terminal device is achannel switch announcement (CSA) manner. Alternatively, the controldevice may indicate, by adding the identifier of the optimal roamingaccess point and the identifier of the operating channel of the optimalroaming access point to the roaming access point indication, that theroaming mode of the terminal device is a basic service set transitionmanagement (BTM) manner. In this way, the control device does not needto send a roaming mode indication to the associated access point anymore, and signaling overheads between the control device and theassociated access point can be reduced.

According to a second aspect, a communications apparatus is provided.The communications apparatus includes a processor, configured toimplement the method performed by the associated access point accordingto the first aspect. The communications apparatus may further include amemory, configured to store a program instruction and data. The memoryis coupled to the processor. The processor may invoke and execute theprogram instruction stored in the memory, to implement any methodperformed by the associated access point according to the first aspect.The communications apparatus may further include a transceiver, wherethe transceiver is configured to implement communication between thecommunications apparatus and another device. For example, the anotherdevice is a control device.

In a possible design, the communications apparatus includes theprocessor and the transceiver, where the transceiver is configured tosend, under the control of the processor, a measurement instruction to aneighboring access point, where the measurement instruction includes anidentifier of a terminal device, the measurement instruction is used toinstruct the neighboring access point to send measured signal strengthof the terminal device to a control device, and an associated accesspoint is an access point associated with the terminal device; thetransceiver is configured to receive, under the control of theprocessor, a roaming access point indication sent by the control device,where the roaming access point indication is used to indicate an optimalroaming access point of the terminal device, and the optimal roamingaccess point is determined based on the signal strength of the terminaldevice that is sent by the neighboring access point; and the transceiveris configured to send, under the control of the processor, a roaminginstruction, where the roaming instruction is used to instruct theterminal device to attempt to roam to the optimal roaming access point.

In a possible design, the transceiver is further configured to:

send a beacon request when sending the measurement instruction, where areceiver address of the beacon request is an address of the terminaldevice, and a value of a measurement mode field of the beacon request isactive.

In a possible design, the transceiver is configured to repeatedly send,under the control of the processor, the beacon request, where lowersignal strength of the terminal device indicates more frequent sendingof the beacon request by the transceiver.

In a possible design, the beacon request includes a channel list field,where the channel list field only includes an operating channel of theneighboring access point.

In a possible design, the roaming access point indication carries anidentifier of the optimal roaming access point and/or an identifier ofan operating channel of the optimal roaming access point.

According to a third aspect, a communications apparatus is provided. Thecommunications apparatus includes a processor, configured to implementthe method performed by the control device according to the firstaspect. The communications apparatus may further include a memory,configured to store a program instruction and data. The memory iscoupled to the processor. The processor may invoke and execute theprogram instruction stored in the memory, to implement any methodperformed by the control device according to the first aspect. Thecommunications apparatus may further include a transceiver, where thetransceiver is configured to implement communication between thecommunications apparatus and another device. For example, the anotherdevice is an associated access point.

In a possible design, the communications apparatus includes theprocessor and the transceiver, where the transceiver is configured toreceive, under the control of the processor, signal strength of aterminal device that is sent by a neighboring access point; theprocessor is configured to determine an optimal roaming access point ofthe terminal device based on the signal strength of the terminal device;and the processor is configured to control the transceiver to send aroaming access point indication to an associated access point, where theroaming access point indication is used to indicate the optimal roamingaccess point, and the associated access point is an access pointassociated with the terminal device.

In a possible design, the roaming access point indication carries anidentifier of the optimal roaming access point and/or an identifier ofan operating channel of the optimal roaming access point.

According to a fourth aspect, a communications apparatus is provided.The communications apparatus may be an associated access point, or maybe an apparatus in the associated access point. The communicationsapparatus may include a processing module and a communications module.These modules may perform corresponding functions performed by theassociated access point in any design example of the first aspect, andspecifically:

the communications module is configured to: send, under the control ofthe processing module, a measurement instruction to a neighboring accesspoint, where the measurement instruction includes an identifier of aterminal device, the measurement instruction is used to instruct theneighboring access point to send measured signal strength of theterminal device to a control device, and an associated access point isan access point associated with the terminal device;

the communications module is further configured to receive a roamingaccess point indication sent by the control device, where the roamingaccess point indication is used to indicate an optimal roaming accesspoint of the terminal device, and the optimal roaming access point isdetermined based on the signal strength of the terminal device that issent by the neighboring access point; and

the communications module is further configured to send a roaminginstruction, where the roaming instruction is used to instruct theterminal device to attempt to roam to the optimal roaming access point.

In a possible design, the communications module is further configuredto:

send a beacon request when sending the measurement instruction, where areceiver address of the beacon request is an address of the terminaldevice, and a value of a measurement mode field of the beacon request isactive.

In a possible design, the communications module repeatedly sends thebeacon request, where lower signal strength of the terminal deviceindicates more frequent sending of the beacon request by thecommunications module.

In a possible design, the beacon request includes a channel list field,where the channel list field only includes an operating channel of theneighboring access point.

In a possible design, the roaming access point indication carries anidentifier of the optimal roaming access point and/or an identifier ofan operating channel of the optimal roaming access point.

According to a fifth aspect, a communications apparatus is provided. Thecommunications apparatus may be a control device, or may be an apparatusin the control device. The communications apparatus may include aprocessing module and a communications module. These modules may performcorresponding functions performed by the control device in any designexample of the first aspect, and specifically:

the communications module is configured to receive signal strength of aterminal device that is sent by a neighboring access point;

the processing module is configured to determine an optimal roamingaccess point of the terminal device based on the signal strength of theterminal device; and

the transceiver module is further configured to send a roaming accesspoint indication to an associated access point, where the roaming accesspoint indication is used to indicate the optimal roaming access point,and the associated access point is an access point associated with theterminal device.

In a possible design, the roaming access point indication carries anidentifier of the optimal roaming access point and/or an identifier ofan operating channel of the optimal roaming access point.

According to a sixth aspect, an embodiment of this application furtherprovides a computer-readable storage medium including an instruction.When the instruction is run on a computer, the computer is enabled toperform the method performed by the associated access point according tothe first aspect.

According to a seventh aspect, an embodiment of this application furtherprovides a computer-readable storage medium including an instruction.When the instruction is run on a computer, the computer is enabled toperform the method performed by the control device according to thefirst aspect.

According to an eighth aspect, an embodiment of this application furtherprovides a computer program product including an instruction. When thecomputer program product is run on a computer, the computer is enabledto perform the method performed by the associated access point accordingto the first aspect.

According to a ninth aspect, an embodiment of this application furtherprovides a computer program product including an instruction. When thecomputer program product is run on a computer, the computer is enabledto perform the method performed by the control device according to thefirst aspect.

According to a tenth aspect, an embodiment of this application providesa chip system. The chip system includes a processor, and may furtherincludes a memory; and is configured to implement the method performedby the associated access point according to the first aspect. The chipsystem may include a chip, or may include a chip and another discretecomponent.

According to an eleventh aspect, an embodiment of this applicationprovides a chip system. The chip system includes a processor, and mayfurther includes a memory; and is configured to implement the methodperformed by the control device according to the first aspect. The chipsystem may include a chip, or may include a chip and another discretecomponent.

According to a twelfth aspect, an embodiment of this applicationprovides a system. The system includes the communications apparatusaccording to the second aspect and the communications apparatusaccording to the third aspect.

According to a thirteenth aspect, an embodiment of this applicationprovides a system. The system includes the communications apparatusaccording to the fourth aspect and the communications apparatusaccording to the fifth aspect.

For beneficial effects of the second aspect to the thirteenth aspect andthe implementations of the second aspect to the thirteenth aspect, referto descriptions of beneficial effects of the method and theimplementations of the method according to the first aspect.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of an example of a WLAN networkarchitecture according to an embodiment of this application;

FIG. 2 is a flowchart of an example of a wireless local area networkroaming method according to an embodiment of this application;

FIG. 3 is a schematic diagram of a format of a beacon request accordingto an embodiment of this application;

FIG. 4 is a schematic diagram of a correspondence between a measurementmode and a value of a measurement mode field according to an embodimentof this application;

FIG. 5 is a schematic diagram in which a terminal device roams from anAP 1 to an AP 2 according to an embodiment of this application;

FIG. 6 is a schematic diagram of an example of a communicationsapparatus according to an embodiment of this application;

FIG. 7 is a schematic diagram of another example of a communicationsapparatus according to an embodiment of this application;

FIG. 8 is a schematic diagram of another example of a communicationsapparatus according to an embodiment of this application; and

FIG. 9 is a schematic diagram of another example of a communicationsapparatus according to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

To make the objectives, technical solutions, and advantages of theembodiments of this application clearer, the following describes thetechnical solutions in the embodiments of this application in detailwith reference to the accompanying drawings in this specification andspecific implementations.

In the following, some terms in the embodiments of this application aredescribed, to help a person skilled in the art have a betterunderstanding.

(1) A terminal device, also referred to as a station (STA), may be awireless communications chip, a wireless sensor, or a wirelesscommunications terminal. For example, a mobile phone supporting a WLANcommunications protocol, a tablet supporting a WLAN communicationsprotocol, a set-top box supporting a WLAN communications protocol, asmart television supporting a WLAN communications protocol, anintelligent wearable device supporting a WLAN communications protocol, avehicle-mounted communications device supporting a WLAN communicationsprotocol, a computer supporting a WLAN communications protocol, avirtual reality (VR) device supporting a WLAN communications protocol,and an augmented reality (augmented reality, AR) device supporting aWLAN communications protocol.

(2) An access point (AP) is an apparatus that provides, by using awireless medium, a distribution system access function (DSAF) for aterminal associated with the access point. The AP may further supportfunctions such as routing, dialing, a dynamic host configurationprotocol (DHCP), roaming, and load balancing. The AP may also bereferred to as an access point, a hotspot, or the like. The AP is anaccess point through which a terminal device accesses a wired network,and is mainly deployed in a house, inside a building, and inside acampus, with a typical coverage radius of tens of meters to hundreds ofmeters. Certainly, the AP may also be deployed outdoors. That theterminal is associated with the AP may be understood as that a mappingbetween the AP and the terminal is established, and the terminal isallowed to invoke a distribution system service (DSS).

(3) A control device is responsible for controlling a plurality of APs.For example, the control device may work as an access controller (AC) ina Control And Provisioning of Wireless Access Points (CAPWAP) protocol.The control device may be an independent or integrated hardware device.For example, the control device may be a single server. The controldevice may alternatively be integrated in a switch or an AP.

(4) “A plurality of” in the embodiments of this application means two ormore than two. In view of this, “a plurality of” in the embodiments ofthis application may also be understood as “at least two”. “At leastone” may be understood as one or more, for example, understood as one,two, or more. For example, “including at least one” means including one,two, or more, and does not limit which is included. For example,including at least one of A, B, and C may represent the following cases:A is included, B is included, C is included, A and B are included, A andC are included, B and C are included, or A and B and C are included.“And/or” describes an association relationship between associatedobjects and represents that three relationships may exist. For example,A and/or B may represent the following three cases: Only A exists, bothA and B exist, and only B exists. The terms “system” and “network” maybe used interchangeably in the embodiments of this application. Unlessotherwise stated, in the embodiments of this application, ordinalnumbers such as “first” and “second” are intended to distinguish betweena plurality of objects, and not intended to limit a sequence, a timesequence, a priority, or importance of the plurality of objects.

The foregoing describes some concepts in the embodiments of thisapplication, and the following describes technical features in theembodiments of this application.

After a terminal device is associated with an AP (that is, an associatedAP) in a WLAN, because of movement of the terminal device, a roamingcondition of the terminal device may be met. The roaming condition maybe that signal strength of the terminal device is less than a presetthreshold. For example, the roaming condition may be that signalstrength of a signal received by the terminal device is less than −65decibel milliwatts (dbm).

Then, the terminal device selects an optimal roaming AP from a pluralityof APs, and roams to the determined optimal roaming AP.

The terminal device needs specific duration to determine the optimalroaming AP, and when the terminal device reaches the set roamingcondition and does not roam, usually, the terminal device is already ata border of signal coverage of the associated AP. Therefore, theterminal device may not accurately receive data sent by the associatedAP before finding the optimal roaming AP, so that data of the terminaldevice is lost in a roaming process, and service experience is affected.

In view of this, the embodiments of this application provides a wirelesslocal area network roaming method. In the method, a control deviceselects, in place of the terminal device, an optimal roaming accesspoint of the terminal device, to reduce a time consumed for determiningthe optimal roaming AP. After the optimal roaming access point of theterminal device is determined, an associated access point instructs theterminal device to attempt to roam to the optimal roaming access point.Because duration required for searching for the optimal roaming AP isreduced, a probability of data loss of the terminal device in a roamingprocess can be reduced, and a roaming effect of the terminal device in awireless local area network is improved.

The following describes an application scenario of the embodiments ofthis application.

FIG. 1 is a schematic diagram of an example of a WLAN networkarchitecture according to an embodiment of this application. In FIG. 1,four APs and a control device are included. The four APs arerespectively an AP 1, an AP 2, an AP 3, and an AP 4. Signal coverage ofthe AP 1 overlaps signal coverage of the AP 2, as shown in an area 1 inFIG. 1. Signal coverage of the AP 1 overlaps signal coverage of the AP3, as shown in an area 2 in FIG. 1. The terminal device is associatedwith the AP 1, to be specific, the AP 1 is an associated AP of theterminal device, and the terminal device is located in the signalcoverage of the AP 1. It should be noted that the control device may bean independent hardware device shown in FIG. 1, or may be integratedinto one of the AP 1 to AP 4 (which is not shown in the schematicdiagram in this embodiment of this application). A specific form of thecontrol device is not limited in this embodiment of this application.

The plurality of APs may be connected in a wired manner. For example,the AP 1 may be connected to the AP 2 through a router by using a wiredcable, or the AP 1 and the AP 2 may be directly connected by using awired cable. A connection mode between the AP 2 and the AP 3 and aconnection mode between the AP 3 and the AP 4 are the same as theconnection mode between the AP 1 and the AP 2, and details are notdescribed herein again. In FIG. 1, an example in which the plurality ofAPs are directly connected by using wired cables is used. The pluralityof APs may be connected to the control device in a wireless or wiredmanner, and the plurality of APs may be directly connected to thecontrol device, or may be connected to the control device by using adevice such as a switch or a gateway. A specific connection mode is notlimited in this embodiment of this application.

It should be noted that quantities of APs, control devices, and terminaldevices in FIG. 1 are merely examples. In actual application, the WLANnetwork architecture provided in this application may provide servicesfor more terminal devices, and may include more APs. In addition, in theWLAN network architecture shown in FIG. 1, although the APs, the controldevice, the terminal device, and a cloud management platform are shown,the WLAN network architecture may not be limited to including theforegoing content. For example, the WLAN network architecture mayfurther include a device that is configured to carry a virtualizednetwork function, a wireless relay device, a switch, a router, and thelike. These are clear for a person of ordinary skill in the art. Detailsare not described herein.

The following describes the technical solutions provided in theembodiments of this application with reference to the accompanyingdrawings.

An embodiment of this application provides a wireless local area networkroaming method. FIG. 2 is a flowchart of the method.

In the following description process, an example in which the method isapplied to the WLAN network architecture shown in FIG. 1 is used. Inother words, an associated access point described below may be the AP 1in the WLAN network architecture shown in FIG. 1, a terminal devicedescribed below may be the terminal device in the WLAN networkarchitecture shown in FIG. 1, a control device described below may bethe control device in the WLAN network architecture described in FIG. 1,and a neighboring AP described below may be one or more of the AP 2 andAP 3 in the WLAN network architecture described in FIG. 1.

For ease of description, an example in which the method is performed bythe AP 1, the control device, and the terminal device is used below.

S201. The associated access point determines that the terminal devicemeets a roaming condition.

After the terminal device accesses the AP 1 in the WLAN network shown inFIG. 1, due to factors such as mobility of the terminal device, airinterface quality, and instability of network quality, the terminaldevice may need to roam to another access point, to obtain a betternetwork service, so that the AP 1 may determine whether the terminaldevice meets the roaming condition.

In this embodiment of this application, the roaming condition may bethat signal strength of a signal that is of the terminal device and thatis received by the associated AP is less than a threshold. In anexample, the signal strength of the terminal device may be representedby a parameter such as a signal-to-noise ratio (SNR) or a receivedsignal strength indication (RSSI).

The threshold may be a preset fixed value, and the threshold may bespecific to all terminal devices. In other words, when signal strengthof a signal of any terminal device is less than the threshold, it isdetermined that the terminal device meets the roaming condition. Forexample, when the SNR is used to indicate the signal strength of theterminal device, the threshold may be 40 dB, 60 dB, or the like. Whenthe RSSI is used to indicate the signal strength of the terminal device,the threshold may be indicated by any digit from 0 to 255. There is apreset object relationship between a digit and a value of the RSSI. Forexample, a digit 0 indicates that a value of the RSSI is −10 dbm, adigit 1 indicates that a value of the RSSI is −20 dbm, a digit 3indicates that a value of the RSSI is −30 dbm, and the rest may bededuced by analogy. When a value of the threshold is 6, it actuallymeans that a value of the RSSI is −60 dbm. Alternatively, a thresholdmay be set for each terminal device. For example, when the SNR is usedto indicate the signal strength of the terminal device, a thresholdcorresponding to a terminal device may be −60 dB, and a thresholdcorresponding to another terminal device may be −70 dB. Certainly, thepreset threshold may alternatively be determined in another manner.

The roaming condition is not limited in this embodiment of thisapplication. For ease of description, an example in which the roamingcondition is that the signal strength of the terminal device is lessthan the preset threshold is used below for description.

After the terminal device accesses the AP 1, the AP 1 measures thesignal strength of the terminal device. To reduce load of the AP 1, theAP 1 may be configured to periodically detect the signal strength of theterminal device, and a period may be 2 s, 5 s, 10 s, or the like. Afterthe AP 1 determines that a measurement result of the signal strength ofthe terminal device is less than the preset threshold, the AP 1determines that the terminal device meets the roaming condition.

It should be noted that in the WLAN architecture shown in FIG. 1, thereis only one terminal device that accesses the AP 1. However, in actualuse, a same AP may allow a plurality of terminal devices to access atthe same time. Therefore, when a plurality of terminal devices accessthe AP 1, the AP 1 needs to measure the signal strength of each terminaldevice, and determine whether each terminal device meets the roamingcondition.

S202. The associated access point sends a measurement instruction to aneighboring access point, and the neighboring access point receives themeasurement instruction.

In this embodiment of this application, the measurement instructionincludes an identifier of the terminal device, and the measurementinstruction is used to instruct the neighboring access point to send themeasured signal strength of the terminal device to the control device.

In this embodiment of this application, the identifier of the terminaldevice may be information such as an address, an index number, aregistration name, or a registration code that are of the terminaldevice. This is not limited herein.

In an example, the measurement instruction can include an identifier ofonly one terminal device. For example, if the AP 1 determines that onlyone terminal device meets the roaming condition, the measurementinstruction includes an identifier of the only one terminal device. Foranother example, when the AP 1 determines that at least two of aplurality of terminal devices connected to the AP 1 meet the roamingcondition, the AP 1 may generate a measurement instruction correspondingto each of the at least two terminal devices, that is, generate at leasttwo measurement instructions, and each measurement instruction includesan identifier of one of the two terminal devices.

In another example, the measurement instruction may include anidentifier of the at least one terminal device. In this way, whendetermining that at least two terminal devices each meet the roamingcondition, the AP 1 may add identifiers of the at least two terminaldevices to one measurement instruction, and therefore, the measurementinstruction is used to instruct the neighboring AP to measure signalstrength of each of the at least two terminal devices, so that signalingoverheads between the AP 1 and the neighboring AP can be reduced.

A manner of sending the measurement instruction to the neighboringaccess point by the AP 1 may include but is not limited to the followingthree types.

A First Sending Manner:

After a WLAN network is deployed, each access point may learn ofinformation about a neighboring access point of each access point, forexample, may obtain an address of the neighboring access point of eachaccess point, for example, a media access control (MAC) address, byusing the control device. Then, the AP 1 may send the measurementrequest to the neighboring access point of the AP 1 in a unicast mannerby using a wired network between the APs.

A Second Sending Manner:

The AP 1 may alternatively send the measurement request to theneighboring access point of the AP 1 in a multicast or broadcast mannerby using the wired network between the APs. For example, the AP 1 mayadd an address of the neighboring access point to payload of themeasurement request. Because the measurement request is sent in amulticast manner, all of the plurality of APs can receive themeasurement request. After receiving the measurement request, each APdetermines whether the measurement request includes an address of theAP. If the address of the AP is not included, the AP discards themeasurement request. For another example, the measurement request doesnot carry the address of the neighboring access point. After receivingthe measurement request, each AP determines whether an AP to which asource address of the measurement request belongs is a neighboring AP ofthe AP. If a sender of the measurement request is not the neighboring APof the AP, the AP discards the measurement request.

A Third Sending Manner:

The AP 1 may alternatively not need to learn of the information aboutthe neighboring access point of the AP 1. The AP 1 sends a firstmeasurement request including the identifier of the terminal device tothe control device. After receiving the measurement request, the controldevice first determines that neighboring APs of the AP 1 are the AP 2and the AP 3, and then sends a second measurement request including theidentifier of the terminal device to the AP 2 and the AP 3.

Certainly, the measurement instruction may alternatively be sent inanother manner. In this embodiment of this application, for ease ofdescription, an example in which the AP 1 generates and sends themeasurement instruction is used for description.

S203. The associated access point sends a beacon request, and theterminal device receives the beacon request.

After determining that the terminal device meets the roaming condition,the AP 1 may send the beacon request (beacon request) by using an airinterface. A receiver address of the beacon request is the address ofthe terminal device. In this way, the terminal device may receive thebeacon request on the air interface.

In addition, in this embodiment of this application, the beacon requestis used to instruct the terminal device to scan, after receiving thebeacon request, a channel by sending a probe frame. In other words, themeasurement process is triggered by actively sending the probe frame bythe terminal device, so that the beacon request further needs toindicate that a measurement mode of the terminal device is an activemode. In this way, after receiving the beacon request, the terminaldevice sends the probe frame on the channel that needs to be scanned.

The following describes a sending time at which the AP 1 sends thebeacon request.

In step S202, the measurement instruction sent by the AP 1 is used toinstruct the neighboring AP to send the measured signal strength of theterminal device to the control device, in other words, the neighboringAP measures the signal strength of the terminal device after a moment ofreceiving the measurement instruction. Only after receiving a signal ofthe terminal device, the neighboring AP can measure signal strength ofthe signal. To increase a possibility of sending the signal by theterminal device during the measurement, the AP 1 sends the beaconrequest to trigger the terminal device to send the probe frame. Afterthe terminal device sends the probe frame, the neighboring AP maymeasure signal strength of the probe frame.

Therefore, step S202 and step S203 need to be performed at the sametime, or a difference between moments at which step S202 and step S203are separately performed is less than a preset time difference. Thepreset time difference may be relatively short duration, for example, 2s or is. Alternatively, if in step S202, the measurement instruction isfurther used to indicate that the neighboring AP needs to send themeasurement result to the control device within a preset time period(for example, 2 s), the difference between the moments at which stepS202 and step S203 are separately performed is less than the preset timeperiod.

The following describes a sending manner of sending the beacon requestby the AP 1.

In this embodiment of this application, the associated access point mayrepeatedly send the beacon request. Lower signal strength of theterminal device indicates more frequent sending of the beacon request bythe associated access node, so that the terminal can perform scanningmore frequently. Therefore, the neighboring AP obtains more measurementresults of the signal strength of the terminal device, and accuracy ofthe measurement result of the signal strength of the terminal device isensured.

In an example, in step S201, when the AP 1 determines, by measuring thesignal strength of the terminal device, whether the terminal devicemeets the roaming condition, the AP 1 may further obtain a differencebetween the measured signal strength of the terminal device and thepreset threshold, and therefore, lower signal strength of the terminaldevice may be understood as: If the difference is relatively large, thesignal strength of the terminal device is lower.

In this case, a correspondence between a difference range and a sendingperiod of the beacon request may be preset in the AP 1. For example,three difference ranges are set. A first difference range is from 0 dbmto 5 dbm, a second difference range is from 6 dbm to 10 dbm, and a thirddifference range is from 11 dbm to 15 dbm. A sending period of thebeacon request corresponding to the first difference range is 200milliseconds (ms), a sending period of the beacon request correspondingto the second difference range is 100 ms, and a sending period of thebeacon request corresponding to the third difference range is 50 ms.

In this way, after obtaining the difference between the signal strengthof the terminal device and the preset threshold, the AP 1 may determine,in the three difference ranges, a difference range in which thedifference is located. For example, if the difference between the signalstrength of the terminal device and the preset threshold is 6 dbm, theAP 1 determines that the difference is located in the second differencerange, so that the sending period of the beacon request is determined as100 ms.

In another example, in step S201, when the AP 1 determines, by measuringthe signal strength of the terminal device, whether the terminal devicemeets the roaming condition, the AP 1 may further obtain a value of aderivative of the signal strength of the terminal device with respect toa time. The derivative of the signal strength with respect to a timeindicates a speed at which the signal strength decreases. Lower signalstrength of the terminal device may be understood as: If the value ofthe derivative is smaller, the signal strength of the terminal device islower.

In this case, a correspondence between a value range of the derivativeand a sending period of the beacon request may be preset in the AP 1.For example, three value ranges of the derivative are set. A first valuerange of the derivative is from 0 dbm/ms to −5 dbm/ms, a second valuerange of the derivative is from −6 dbm/ms to −10 dbm/ms, and a thirdvalue range of the derivative is less than or equal to −11 dbm/ms. And asending period of the beacon request corresponding to each value rangeof the derivative is set. If the derivative of the signal strength isgreater than 0 dbm/ms, the signal of the terminal is enhanced.Therefore, roaming is not required.

In this way, after obtaining the value of the derivative of the signalstrength of the terminal device with respect to a time, the AP 1 maydetermine the sending period of the beacon request.

The signal strength of the terminal device may alternatively berepresented by using another parameter. This is not limited herein.

The following describes a specific format of the beacon request.

FIG. 3 is a schematic diagram of a format of a beacon request. As shownin FIG. 3, the beacon request includes the following seven fields.

1. An operating class is used to indicate an operating class of achannel group to which the beacon request is applicable.

2. A channel number is used to indicate a channel used by the beaconrequest.

3. A randomization interval is used to indicate an upper limit of arandom delay to be used before measurement is performed. It may beunderstood that, after receiving the beacon request, the terminal deviceneeds to start the measurement as soon as possible within durationindicated by the randomization interval field.

4. Measurement duration is used to indicate duration of scanning eachchannel by the terminal device. A value of the field may be set to 100time units (time unit, TU), each TU may be 1.024 ms, and a value of thefield may also be set to a value less than 100 TUs. This is not limitedherein.

5. A measurement mode is used to indicate a mode in which the terminaldevice scans the channel. Referring to FIG. 4, there may be fourmeasurement modes, and the four measurement modes are respectively: apassive mode, an active mode, a beacon table mode, and a reserved mode.That a value of the field is 0 is used to indicate that the measurementmode is the passive mode, that a value of the field is 1 is used toindicate that the measurement mode is the active mode, that a value ofthe field is 2 is used to indicate that the measurement mode is thebeacon table mode, and that a value of the field is greater than 2 isused to indicate that the measurement mode is the reserved mode.

It can be learned from the foregoing content that, in this embodiment ofthis application, the value of the measurement mode field may be set toa value corresponding to the active mode.

6. A basic service set identifier (BSSID) is used to indicate anidentifier of a WLAN in which the AP 1 is located, and when a beaconreport corresponding to the beacon request is fed back, an ID indicatedby the BSSID field should be carried.

7. An optional subelement may include other information, for example,may include an SSID, an extended request, information about whether tosend a beacon report, and the like, and this is not listed one by oneherein.

For a meaning of each field, refer to section 9.4.4.21.7 of theinstitute of electrical and electronics engineers (IEEE) 802.11-2016protocol, and related content of the beacon request is not describedherein again.

In a possible implementation, a channel list field may be added to theoptional sub-element field, where the channel list field includes onlyan operating channel of the neighboring access point.

In an example, after the WLAN is deployed, the control device maycontrol each AP to obtain BSSID information of a surrounding AP throughscanning, and then report the scanned basic service set identifier(BSSID) to the control device. The control device determines, based onthe BSSID reported by each AP, a neighboring AP corresponding to each APand an operating channel of the neighboring AP, to generate aneighboring AP channel set corresponding to each AP, and sends theneighboring AP channel set corresponding to each AP to a correspondingAP. For example, the control device may determine, based on BSSIDsreported by the AP 2 and the AP 3, that a neighboring AP channel set ofthe AP 1 includes an operating channel of the AP 2 and an operatingchannel of the AP 3, and when the AP 1 sends the beacon request to theterminal device, the neighboring AP channel set of the AP 1 may befilled in the optional sub-element field. In this way, after receivingthe beacon request, the terminal device may scan only a neighboringchannel indicated in the optional sub-element field, so that a quantityof channels that the terminal device needs to scan can be reduced,thereby reducing time overheads of scanning the channels by the terminaldevice.

It should be noted that the beacon request may not include the channellist field, and in this case, it may be implicitly indicated that theterminal device needs to scan all channels.

In addition, it should be noted that S203 is an optional step, in otherwords, S203 does not necessarily need to be performed. In an example, ifa frequency of the operating channel of the AP 1 is the same as afrequency of the operating channel of the neighboring APs (AP 2 and AP3), all signals (for example, signals that carry data of the terminaldevice) sent by the terminal device can also be received by theneighboring APs. In this case, the AP 1 may not send the beacon request.The beacon request is used to instruct the terminal device to send theprobe frame to perform channel scanning. Therefore, when the terminaldevice does not receive the beacon request, the terminal device does notsend the probe frame to the neighboring AP. In this way, after receivingthe measurement request sent by the AP 1, the neighboring AP may measureany signal sent by the terminal device, for example, measure a signalcarrying data of the terminal device (which may also be referred to as adata signal) that is sent by the terminal device, to obtain the signalstrength of the terminal device. Alternatively, a plurality of datasignals sent by the terminal device may be measured, an average value ofmeasurement results of the plurality of data signals is calculated, andthe average value is used as the signal strength of the signal of theterminal device. Alternatively, the AP 1 may not send the beaconrequest, but sends any signal to the terminal device in a unicastmanner. The signal may be a control frame or a data frame, or may be anempty packet with only a header and without data. After receiving thesignal, the terminal device feeds back a response signal to the AP 1,and the neighboring AP may also obtain the signal strength of the signalof the terminal device by measuring the response signal.

In FIG. 2, an example in which step S203 is performed is used fordescription. In FIG. 2, step S203 is represented by a solid line.

S204. The terminal device sends the probe frame to perform channelscanning, and the neighboring access point receives the probe frame.

After receiving the beacon request sent by the AP 1, the terminal deviceobtains, by parsing the beacon request, an operating channel of theneighboring AP that is indicated in the beacon request, for example, anoperating channel of the AP 2 and an operating channel of the AP 3.Then, the probe frame is sequentially sent on each channel to perform anoperation. Specifically, the terminal device first sends the probe frameon the operating channel of the AP 2, starts a timer, and recordsduration of scanning the operating channel of the AP 2 by the terminaldevice. When the duration of the scanning reaches measurement durationindicated in the beacon request, the terminal device switches to anoperating channel of another AP that is indicated by the beacon requestfor performing scanning, for example, switches to the operating channelof the AP 3 for performing scanning, until scanning on the operatingchannels of all the neighboring APs that are indicated in the beaconrequest is completed.

S205. The neighboring access point measures the probe frame, to obtainthe signal strength of the terminal device.

When receiving the probe frame sent by the terminal device, the AP 2 andthe AP 3 measure the probe frame, and a measurement result is used asthe signal strength of the terminal device that is obtained by the AP.

It should be noted that, because the terminal device scans the channelsin sequence, if the terminal device first scans the operating channel ofthe AP 2 and then scans the operating channel of the AP 3, the AP 2obtains the signal strength of the terminal device before the AP 3, thatis, there may be a specific time interval of times for obtaining thesignal strength of the terminal device by the plurality of neighboringAPs, and the time interval may be measurement duration of the terminaldevice on each channel. Certainly, because a time required by each AP tomeasure the signal strength of the terminal device is different, thetime interval may also be another value, and the time interval is notlimited herein.

S206. The neighboring access point sends, to the control device, asignal used to indicate the signal strength of the terminal device, andthe control device receives the signal.

In this embodiment of this application, the signal may includeinformation such as the SNR or the RSSI of the terminal device.

S207. The control device determines an optimal roaming access point ofthe terminal device.

After receiving the signal that is used to indicate the signal strengthof the terminal device and that is reported by the neighboring AP, thecontrol device selects a neighboring AP corresponding to a maximum valueof the signal strength of the terminal device as the optimal roamingaccess point of the terminal device. For example, an SNR that is of thesignal of the terminal device and that is reported by the neighboring APis used as the signal strength of the terminal device. For example, anSNR reported by the AP 2 is −40 dB, and an SNR reported by the AP 3 is−50 dB. Because −40 dB>−50 dB, the control device selects the AP 2 asthe optimal roaming access point of the terminal device.

Certainly, the control device may alternatively comprehensivelydetermine the optimal roaming access point of the terminal device withreference to other information of each neighboring AP. For example, thecontrol device may further determine whether a bandwidth of theoperating channel of each neighboring AP meets a requirement of theterminal device. For example, the terminal device requires an operatingbandwidth of 80 megahertz (MHz), and the control device determines thata bandwidth of the operating channel of the AP 2 is 40 MHz and abandwidth of the operating channel of the AP 3 is 160 MHz; and an SNRreported by the AP 3 is greater than signal strength of the terminaldevice when the terminal device roams, so that the control device candetermine that the AP 3 is the optimal roaming access point of theterminal device. Certainly, the control device may alternativelydetermine the optimal roaming access point of the terminal device inanother manner. This is not limited herein.

In the following description, an example in which the AP 2 is theoptimal roaming access point of the terminal device is used fordescription.

S208. The control device sends a roaming access point indication to theassociated access point, and the associated access point receives theroaming access point indication.

In this embodiment of this application, the roaming access pointindication is used to indicate the optimal roaming access point of theterminal device. Specifically, the roaming access point indication maycarry an identifier of the optimal roaming access point and/or anidentifier of an operating channel of the optimal roaming access point.

It should be noted that the roaming access point indication may furtherimplicitly indicate a roaming mode of the terminal device. In thisembodiment of this application, the roaming mode may be divided into achannel switch announcement (CSA) manner and a basic service settransition management (BSS transition management, BTM) manner. The CSAmanner is used to indicate that when an operating channel associatedwith the terminal device changes, and if the terminal device isinstructed to roam in the CSA manner, the identifier of the operatingchannel of the optimal roaming access point may be carried in theroaming access point indication, to instruct the terminal device toswitch from a current operating channel to an indicated operatingchannel. The associated access point does not switch the operatingchannel, so the associated access point guides the terminal device to adevice whose operating channel is a channel indicated by the CSA, thatis, the optimal roaming access point. If the terminal device isinstructed to roam in a BTM manner, the roaming access point indicationmay carry a BSSID of the optimal roaming access point and/or theidentifier of the operating channel of the optimal roaming access point.For a meaning of the BTM manner, refer to section 4.3.18.3 of theinstitute of electrical and electronics engineers (IEEE) 802.11-2016protocol, and details are not described herein.

S209. The associated access point sends a roaming instruction, and theterminal device receives the roaming instruction.

In this embodiment of this application, the roaming instruction is usedto instruct the terminal device to attempt to roam to the optimalroaming access point.

After receiving the roaming access point indication sent by the controldevice, the AP 1 indicates the optimal roaming access point and theroaming mode indicated by the control device to the terminal device, andguides the terminal device to roam to the optimal roaming access point.

S210. The terminal device roams to the optimal roaming access pointbased on the roaming instruction.

After receiving the roaming instruction sent by the AP 1, the terminaldevice may roam to the optimal roaming access point. For example, if theoptimal roaming access point is the AP 2, the terminal device may sendan access request to the AP 2. After the AP 2 allows the terminal deviceto access, and sends an access permission indication to the terminaldevice, the terminal device roams to the AP 2, as shown in FIG. 5.

Certainly, after receiving the roaming instruction, the terminal devicemay choose not to perform roaming, and whether roaming occurs may bedetermined based on a roaming policy set by the terminal device. Anexample in which the terminal device roams to the optimal roaming accesspoint based on the roaming instruction is used in FIG. 2.

In the foregoing technical solutions, when determining that the terminaldevice reaches the roaming condition but does not roam, the associatedaccess point notifies the neighboring access point of measuring thesignal strength of the terminal device, and reports the measurementresult to the control device. Therefore, the control device selects theoptimal roaming access point for the terminal device, and guides theterminal device to roam to the optimal roaming access point, so thatduration required by the terminal device to detect the optimal roamingAP in the current environment can be reduced, a probability of data lossof the terminal device in the roaming process can be reduced, and aroaming effect of the terminal device in a wireless local area networkis improved.

In the foregoing embodiments provided in this application, the methodprovided in the embodiments of this application is described separatelyfrom perspectives of the associated access point, the neighboring accesspoint, the control device, the terminal, and interaction between theassociated access point, the neighboring access point, the controldevice, and the terminal. To implement the functions in the methodprovided in the foregoing embodiments of this application, theassociated access point, the neighboring access point, the controldevice, and the terminal may include a hardware structure and/or asoftware module, to implement the foregoing functions in a form of thehardware structure, the software module, or a combination of thehardware structure and the software module. Whether a function in theforegoing functions is performed in a manner of the hardware structure,the software module, or a combination of the hardware structure and thesoftware module depends on a specific application and a designconstraint condition of the technical solutions.

FIG. 6 is a schematic structural diagram of a communications apparatus600. The communications apparatus 600 may be an associated access point,and can implement functions of the associated access point in the methodprovided in the embodiments of this application. Alternatively, thecommunications apparatus 600 may be an apparatus that can support theassociated access point in implementing the functions of the associatedaccess point in the method provided in the embodiments of thisapplication. The communications apparatus 600 may be a hardwarestructure, a software module, or a combination of the hardware structureand the software module. The communications apparatus 600 may beimplemented by a chip system. In this embodiment of this application,the chip system may include a chip, or may include a chip and anotherdiscrete component.

The communications apparatus 600 may include a processing module 601 anda communications module 602.

The processing module 601 may be configured to perform step S201 in theembodiment shown in FIG. 2, and/or configured to support another processof the technology described in this specification. The communicationsmodule 602 is configured to implement communication between thecommunications apparatus 600 and another module. The communicationsmodule 602 may be a circuit, a component, an interface, a bus, asoftware module, a transceiver, or any other apparatus that canimplement communication.

The communications module 602 may be configured to perform step S202,step S203, step S208 and step S209 in the embodiment shown in FIG. 2,and/or configured to support another process of the technology describedin this specification.

All related content of the steps in the foregoing method embodiment maybe cited in function descriptions of corresponding function modules, anddetails are not described herein again.

FIG. 7 is a schematic structural diagram of a communications apparatus700. The communications apparatus 700 may be a control device, and canimplement functions of the control device in the method provided in theembodiments of this application. Alternatively, the communicationsapparatus 700 may be an apparatus that can support the control device inimplementing the functions of the control device in the method providedin the embodiments of this application. The communications apparatus 700may be a hardware structure, a software module, or a combination of thehardware structure and the software module. The communications apparatus700 may be implemented by a chip system. In this embodiment of thisapplication, the chip system may include a chip, or may include a chipand another discrete component.

The communications apparatus 700 may include a processing module 701 anda communications module 702.

The processing module 701 may be configured to perform step S207 in theembodiment shown in FIG. 2, and/or configured to support another processof the technology described in this specification.

The communications module 702 may be configured to perform step S206 andstep S208 in the embodiment shown in FIG. 2, and/or configured tosupport another process of the technology described in thisspecification. The communications module 702 is configured to implementcommunication between the communications apparatus 700 and anothermodule. The communications module 702 may be a circuit, a component, aninterface, a bus, a software module, a transceiver, or any otherapparatus that can implement communication.

All related content of the steps in the foregoing method embodiment maybe cited in function descriptions of corresponding function modules, anddetails are not described herein again.

In this embodiment of this application, module division is an example,and is merely logical function division and may be another divisionmanner in actual implementation. In addition, function modules in theembodiments of this application may be integrated into one processor, oreach of the modules may exist alone physically, or at least two modulesmay be integrated into one module. The integrated module may beimplemented in a form of hardware, or may be implemented in a form of asoftware function module.

FIG. 8 shows a communications apparatus 800 according to an embodimentof this application. The communications apparatus 800 may be theassociated access point shown in FIG. 2, and can implement functions ofthe associated access point in the method provided in the embodiments ofthis application. Alternatively, the communications apparatus 800 may bean apparatus that can support the associated access point inimplementing the functions of the associated access point in the methodprovided in the embodiments of this application. The communicationsapparatus 800 may be a chip system. In this embodiment of thisapplication, the chip system may include a chip, or may include a chipand another discrete component.

The communications apparatus 800 includes at least one processor 820,configured to implement or support the communications apparatus 800 inimplementing the functions of the associated access point in the methodprovided in the embodiments of this application. For example, theprocessor 820 may determine that the terminal device meets the roamingcondition. For details, refer to detailed descriptions in the methodexample, and details are not described herein again.

The communications apparatus 800 may further include at least one memory830, configured to store a program instruction and/or data. The memory830 is coupled to the processor 820. Couplings in this embodiment ofthis application are indirect couplings or communication connectionsbetween apparatuses, units, or modules, may be electrical, mechanical,or another form, and are used for information interaction between theapparatuses, the units, and the modules. The processor 820 may operatewith the memory 830 together. The processor 820 may execute the programinstruction stored in the memory 830. At least one of the at least onememory may be included in the processor.

The communications apparatus 800 may further include a communicationsinterface 810, configured to communicate with another device through atransmission medium, so that an apparatus in the communicationsapparatus 800 can communicate with the another device. For example, theanother device may be a control device. The processor 820 may send andreceive data by using the communications interface 810.

In this embodiment of this application, a specific connection mediumbetween the communications interface 810, the processor 820, and thememory 830 is not limited. In this embodiment of this application, thememory 830, the processor 820, and the communications interface 810 areconnected by using a bus 840 in FIG. 8, where the bus is represented bya bold line in FIG. 8. A connection mode between other components isschematically described, and is not limited herein. The bus may beclassified into an address bus, a data bus, a control bus, or the like.For ease of representation, the bus is represented by using only onebold line in FIG. 8. However, it does not mean that there is only onebus or only one type of bus.

In this embodiment of this application, the processor 820 may be ageneral-purpose processor, a digital signal processor, anapplication-specific integrated circuit, a field programmable gate arrayor another programmable logic device, a discrete gate or a transistorlogic device, or a discrete hardware component, and may implement orperform the methods, steps, and logical block diagrams disclosed in theembodiments of this application. The general-purpose processor may be amicroprocessor, any conventional processor, or the like. The steps inthe method disclosed with reference to the embodiments of thisapplication may be directly performed by a hardware processor, or may beperformed by using a combination of hardware and software modules in theprocessor.

In this embodiment of this application, the memory 830 may be anon-volatile memory such as a hard disk drive (HDD) or a solid-statedrive (SSD), or may be a volatile memory such as a random-access memory(RAM). The memory is any other medium that can be used to carry or storeexpected program code in a form of an instruction or a data structureand that is accessible to a computer, but is not limited thereto. Thememory in this embodiment of this application may alternatively be acircuit or any other apparatus that can implement a storage function,and is configured to store a program instruction and/or data.

FIG. 9 shows a communications apparatus 900 according to an embodimentof this application. The communications apparatus 900 may be a controldevice, and can implement functions of the control device in the methodprovided in the embodiments of this application. Alternatively, thecommunications apparatus 900 may be an apparatus that can support thecontrol device in implementing the functions of the control device inthe method provided in the embodiments of this application. Thecommunications apparatus 900 may be a chip system. In this embodiment ofthis application, the chip system may include a chip, or may include achip and another discrete component.

The communications apparatus 900 includes at least one processor 920,configured to implement or support the communications apparatus 900 inimplementing the functions of the control device in the method providedin the embodiments of this application. For example, the processor 920may determine an optimal roaming access point of a terminal device. Fordetails, refer to detailed descriptions in the method example, anddetails are not described herein again.

The communications apparatus 900 may further include at least one memory930, configured to store a program instruction and/or data. The memory930 is coupled to the processor 920. Couplings in this embodiment ofthis application are indirect couplings or communication connectionsbetween apparatuses, units, or modules, may be electrical, mechanical,or another form, and are used for information interaction between theapparatuses, the units, and the modules. The processor 920 may operatewith the memory 930 together. The processor 920 may execute the programinstruction stored in the memory 930. At least one of the at least onememory may be included in the processor.

The communications apparatus 900 may further include a communicationsinterface 910, configured to communicate with another device through atransmission medium, so that an apparatus in the apparatus 900 cancommunicate with the another device. For example, the another device isan associated access point. The processor 920 may send and receive databy using the communications interface 910.

In this embodiment of this application, a specific connection mediumbetween the communications interface 910, the processor 920, and thememory 930 is not limited. In this embodiment of this application, thememory 930, the processor 920, and the communications interface 910 areconnected by using a bus 940 in FIG. 9, where the bus is represented bya bold line in FIG. 9. A connection mode between other components isschematically described, and is not limited herein. The bus may beclassified into an address bus, a data bus, a control bus, or the like.For ease of representation, the bus is represented by using only onebold line in FIG. 9. However, it does not mean that there is only onebus or only one type of bus.

In this embodiment of this application, the processor 920 may be ageneral-purpose processor, a digital signal processor, anapplication-specific integrated circuit, a field programmable gate arrayor another programmable logic device, a discrete gate or a transistorlogic device, or a discrete hardware component, and may implement orperform the methods, steps, and logical block diagrams disclosed in theembodiments of this application. The general-purpose processor may be amicroprocessor, any conventional processor, or the like. The steps inthe method disclosed with reference to the embodiments of thisapplication may be directly performed by a hardware processor, or may beperformed by using a combination of hardware and software modules in theprocessor.

In this embodiment of this application, the memory 930 may be anon-volatile memory such as a hard disk drive (HDD) or a solid-statedrive (SSD), or may be a volatile memory such as a random-access memory(RAM). The memory is any other medium that can be used to carry or storeexpected program code in a form of an instruction or a data structureand that is accessible to a computer, but is not limited thereto. Thememory in this embodiment of this application may alternatively be acircuit or any other apparatus that can implement a storage function,and is configured to store a program instruction and/or data.

An embodiment of this application further provides a computer-readablestorage medium including an instruction. When the instruction is run ona computer, the computer is enabled to perform the method implemented bythe associated access point in the embodiment shown in FIG. 2.

An embodiment of this application further provides a computer-readablestorage medium including an instruction. When the instruction is run ona computer, the computer is enabled to perform the method implemented bythe control device in the embodiment shown in FIG. 2.

An embodiment of this application further provides a computer programproduct including an instruction. When the computer program product isrun on a computer, the computer is enabled to perform the methodimplemented by the associated access point in the embodiment shown inFIG. 2.

An embodiment of this application further provides a computer programproduct including an instruction. When the computer program product isrun on a computer, the computer is enabled to perform the methodimplemented by the control device in the embodiment shown in FIG. 2.

An embodiment of this application provides a chip system. The chipsystem includes a processor, may further include a memory, and isconfigured to implement functions of the associated access point in theforegoing method. The chip system may include a chip, or may include achip and another discrete component.

An embodiment of this application provides a chip system. The chipsystem includes a processor, may further include a memory, and isconfigured to implement functions of the control device in the foregoingmethod. The chip system may include a chip, or may include a chip andanother discrete component.

An embodiment of this application provides a system, and the systemincludes the foregoing associated access point and the foregoing controldevice.

All or some of the method in the embodiments of this application may beimplemented by using software, hardware, firmware, or any combinationthereof. When the embodiments are implemented by using software orfirmware, all or some of the embodiments may be implemented in a form ofa computer program product. The computer program product includes one ormore computer instructions. When the computer program instruction isloaded and executed on a computer, the procedure or function accordingto the embodiments of the present invention are completely or partiallygenerated. The computer may be a general-purpose computer, aspecial-purpose computer, a computer network, a network device, userequipment, or another programmable apparatus. The computer instructionsmay be stored in a computer-readable storage medium or may betransmitted from a computer-readable storage medium to anothercomputer-readable storage medium. For example, the computer instructionsmay be transmitted from a website, computer, server, or data center toanother website, computer, server, or data center in a wired (forexample, a coaxial cable, an optical fiber, or a digital subscriber line(DSL)) or wireless (for example, infrared, radio, or microwave) manner.The computer-readable storage medium may be any usable medium accessibleby a computer, or a data storage device, such as a server or a datacenter, integrating one or more usable media. The usable medium may be amagnetic medium (for example, a floppy disk, a hard disk, or a magnetictape), an optical medium (for example, a digital video disc (DVD)), asemiconductor medium (for example, an SSD), or the like.

Clearly, a person skilled in the art may make various modifications andvariations to this application without departing from the scope of thisapplication. This application is intended to cover these modificationsand variations provided that they fall within the scope of protectiondefined by the claims of this application and their equivalenttechnologies.

What is claimed is:
 1. A wireless local area network roaming method,comprising: sending, by an associated access point, a measurementinstruction to a neighboring access point, wherein the measurementinstruction comprises an identifier of a terminal device, themeasurement instruction is used to instruct the neighboring access pointto send a measured signal strength of the terminal device to a controldevice, and the associated access point is an access point associatedwith the terminal device, wherein the measurement instruction is used toinstruct the neighboring access point to send the measured signalstrength of the terminal device to the control device within a presettime period in response to a frequency of an operating channel of theassociated access point not being the same as a frequency of anoperating channel of the neighboring access point; sending, by theassociated access point, a beacon request while sending the measurementinstruction in response to a frequency of an operating channel of theassociated access point not being the same as a frequency of anoperating channel of the neighboring access point, wherein a receiveraddress of the beacon request is an address of the terminal device, andwherein a value of a measurement mode field of the beacon request isactive; receiving, by the associated access point, a roaming accesspoint indication sent by the control device, wherein the roaming accesspoint indication is used to indicate an optimal roaming access point ofthe terminal device, and the optimal roaming access point is determinedbased on the measured signal strength of the terminal device that issent by the neighboring access point to the control device, wherein theassociated access point is implemented in a device other than thecontrol device and wherein the neighboring access point is implementedin a device other than the control device; and sending, by theassociated access point, a roaming instruction, wherein the roaminginstruction is used to instruct the terminal device to attempt to roamto the optimal roaming access point.
 2. The method according to claim 1,wherein the associated access point repeatedly sends the beacon request,and a lower signal strength of the terminal device indicates morefrequent sending of the beacon request by the associated access point.3. The method according to claim 1, wherein the beacon request comprisesa channel list field, wherein the channel list field comprises only anoperating channel of the neighboring access point.
 4. The methodaccording to claim 1, wherein the roaming access point indicationcarries one or both of an identifier of the optimal roaming access pointand an identifier of an operating channel of the optimal roaming accesspoint.
 5. A wireless local area network roaming method, comprising:receiving, by a control device, a signal strength of a terminal devicethat is sent by a neighboring access point within a preset time periodbased on a measurement instruction and a beacon request from anassociated access point in response to a frequency of an operatingchannel of the associated access point not being the same as a frequencyof an operating channel of the neighboring access point, wherein areceiver address of the beacon request is an address of the terminaldevice, and wherein a value of a measurement mode field of the beaconrequest is active; determining, by the control device, an optimalroaming access point of the terminal device based on the signal strengthof the terminal device; and sending, by the control device, a roamingaccess point indication to the associated access point, wherein theroaming access point indication is used to indicate the optimal roamingaccess point, and the associated access point is an access pointassociated with the terminal device, wherein the associated access pointis implemented in a device other than the control device and wherein theneighboring access point is implemented in a device other than thecontrol device.
 6. The method according to claim 5, wherein the roamingaccess point indication carries one or both of an identifier of theoptimal roaming access point and an identifier of an operating channelof the optimal roaming access point.
 7. A communications apparatus,comprising a processor and a transceiver, wherein the communicationsapparatus is an associated access point, the transceiver is configuredto send, under control of the processor, a measurement instruction to aneighboring access point, wherein the measurement instruction comprisesan identifier of a terminal device, the measurement instruction is usedto instruct the neighboring access point to send a measured signalstrength of the terminal device to a control device, and the associatedaccess point is an access point associated with the terminal device,wherein the measurement instruction is used to instruct the neighboringaccess point to send the measured signal strength of the terminal deviceto the control device within a preset time period in response to afrequency of an operating channel of the associated access point notbeing the same as a frequency of an operating channel of the neighboringaccess point; the transceiver is configured to send, under control ofthe processor, a beacon request while sending the measurementinstruction in response to a frequency of an operating channel of theassociated access point not being the same as a frequency of anoperating channel of the neighboring access point, wherein a receiveraddress of the beacon request is an address of the terminal device, andwherein a value of a measurement mode field of the beacon request isactive; the transceiver is configured to receive, under control of theprocessor, a roaming access point indication sent by the control device,wherein the roaming access point indication is used to indicate anoptimal roaming access point of the terminal device, and the optimalroaming access point is determined based on the measured signal strengthof the terminal device that is sent by the neighboring access point tothe control device, wherein the associated access point is implementedin a device other than the control device and wherein the neighboringaccess point is implemented in a device other than the control device;and the transceiver is configured to send, under control of theprocessor, a roaming instruction, wherein the roaming instruction isused to instruct the terminal device to attempt to roam to the optimalroaming access point.
 8. The apparatus according to claim 7, wherein thetransceiver is configured to repeatedly send, under control of theprocessor, the beacon request, and a lower signal strength of theterminal device indicates more frequent sending of the beacon request bythe associated access point.
 9. The apparatus according to claim 7,wherein the beacon request comprises a channel list field, wherein thechannel list field comprises only an operating channel of theneighboring access point.
 10. The apparatus according to claim 7,wherein the roaming access point indication carries one or both of anidentifier of the optimal roaming access point and an identifier of anoperating channel of the optimal roaming access point.